
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
module.exports = {
    webpack: {
        configure: (config) => {
            config.entry = './src/index.js'; // 修改入口文件路径

            return config;
        },
        optimization: {
            minimize: true,
            minimizer: [new TerserPlugin()],
        },
        module: {
            rules: [
                {
                    test: /\.(jpe?g|png|gif|svg)$/i,
                    type: "asset",
                },
            ],
        },
        plugins: [
            new HtmlWebpackPlugin({
                template: path.join(__dirname, './', 'public/index.html'),
            }),
        ],
    },
};